let env = process.argv.splice(2)[0] || 'dev';
let supportedEnv = 'dev,stage,pre,prod';

if (!supportedEnv.split(',').includes(env)) throw new Error(`请在启动参数中传入正确的参数 one of: ${supportedEnv}`)

let appConfig = './appConfig';
appConfig = appConfig[env];

module.exports = {
  APP_CONFIG: {
    NODE_ENV: env === 'production' ? 'production' : 'development',
    env,
    ...appConfig
  }
};